package redis;

import javax.annotation.Resource;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)  
@ContextConfiguration(locations ={"classpath:applicationContext.xml"})  
public class RedisDemo {
	
	@Resource
	private RedisTemplate<String, Integer> redisTemplate;
	@Test
	public void doTest(){
		redisTemplate.opsForHash().increment("pv", "url1", 1);
		System.out.println(redisTemplate.opsForHash().get("pv", "url1"));
	}
}
